<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <title>OSMP 指令生成模块</title>
  <link rel="stylesheet" href="/static/css/bootstrap.min.css">
  <link rel="stylesheet" href="/static/css/font-awesome.min.css">
  <link rel="stylesheet" href="../qv.css">
</head>
<body>
<div class="d-flex flex-row p-2" style="height: 100vh">
  <div class="left-plan d-flex flex-column me-2 p-0">
    <h1> 指令上注模块</h1>
    <div class="ncard mb-2"></div>
    <div class="ncard flex-grow-1 d-flex flex-column mb-0">
      <div><label for="sel1"> 选择指令集</label></div>
      <select id="sel1" class="x-sel flex-grow-1" size="2"
              onchange="document.querySelector('iframe').src=this.value+'.html'">
        <option value="amac">中视场彩色相机</option>
        <option value="awac">宽视场导航敏感器</option>
        <option value="anac">窄视场导航敏感器</option>
        <option value="amsc">多光谱相机</option>
        <option value="ardis">旋转衍射高光谱相机</option>
        <option value="ates">热辐射光谱仪</option>
        <option value="aviris">可见红外成像光谱仪</option>
        <option value="dma">喷发物分析仪-尘埃分析仪</option>
        <option value="vita">喷发物分析仪-挥发分分析仪</option>
        <option value="canpa">带电粒子与中性粒子分析仪</option>
        <option value="aladar">激光一体化导航敏感器</option>
        <option value="acsr">探测雷达</option>
        <option value="amag">磁强计</option>
        <option value="apmu">载荷管理单元</option>
      </select>
    </div>
  </div>
  <div class="d-flex flex-column flex-grow-1  me-2  mb-0">
    <iframe class="flex-grow-1"
            src="amac.html" style="border: 1px solid #08f"></iframe>
  </div>
  <div class="d-flex flex-column card mb-0" style="width: 500px;background: #EEE;border: 1px solid #08f;">
    <label for="norm_code" class="card-header"><i class="fa fa-code-fork"></i> 常用指令指令集合</label>
    <select id="norm_code" class="x-sel flex-grow-1 w-100 border-0" style="font-size: unset !important;" size="2">
      <option>可以保存参数方案</option>
      <option>用于回填编辑页面</option>
      <option>根据指令集分类检索</option>
      <option>显示全部方案</option>
    </select>
    <div class="card-footer"><i class="fa fa-code"></i> 指令预览</div>
    <div class="p-2" style="min-height: 50px;" id="OUTPUT">
    </div>
    <div class="card-footer">
      <button class="btn btn-primary p-3" onclick="save_code()"> 保存为常用方案</button>
      <button class="btn btn-warning p-3" onclick="rm_code()"> 删除方案</button>
      <button class="btn btn-danger p-3 float-end" onclick="send_code()"> 上注指令发送</button>
    </div>
    <div class="card-footer"></div>
  </div>
</div>
<script src="/static/js/xtool.js"></script>
<script>
  async function save_code() {
    $api('omsp.code.save',{code: '',name:'',values:[]})
  }

  async function send_code() {
    $api('omsp.code.send',{code: '',name:'',values:[]})
  }
  async function rm_code() {
    $api('omsp.code.rm',{code: '',name:'',values:[]})
  }

</script>
</body>
</html>